﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Nivdal.Shop" CodeBehind="Shop.aspx.cs"
    Theme="SkinFile" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="StyleSheetNew.css" rel="stylesheet" type="text/css" />
    <link href="NoamStyles/Global.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        window.onload = function () {
            var InsertTeamIdLabelControl = document.getElementById('InsertTeamIdTitleLabel');
            var TeamIdTextBoxControl = document.getElementById('TeamIdTextBox');
            var setButton = document.getElementById('SetButton');
            InsertTeamIdLabelControl.style.display = "none"; //to hide it
            TeamIdTextBoxControl.style.display = "none"; //to hide it
            setButton.style.display = "none"; //to hide it

            var InsertTournamentIdLabel = document.getElementById('InsertTournamentIdLabel');
            var TournamentIdTextBox = document.getElementById('TournamentIdTextBox');
            var SetTournamentButton = document.getElementById('SetTournamentButton');

            if (TournamentIdTextBox.value.length == 0) {
                InsertTournamentIdLabel.style.display = "none";
                TournamentIdTextBox.style.display = "none";
                SetTournamentButton.style.display = "none";
            }
        };
        function showHideControl(PayTypeRadioButtonList) {
            for (var i = 0; i < PayTypeRadioButtonList.rows.length; ++i) {

                if (PayTypeRadioButtonList.rows[i].cells[0].firstChild.checked) {
                    //alert(PayTypeRadioButtonList.rows[i].cells[0].firstChild.value);
                    var InsertTeamIdLabelControl = document.getElementById('InsertTeamIdTitleLabel');
                    var TeamIdTextBoxControl = document.getElementById('TeamIdTextBox');
                    var IsFriendControl = document.getElementById('IsFriend');
                    var MessageLabel = document.getElementById('MessageLabel');
                    var PayForMySelf = document.getElementById('PayForMySelfHidden');
                    var PayForAnotherTeam = document.getElementById('PayForAnotherTeamHidden');
                    var custom = document.getElementById('custom');
                    var CurrentUserId = document.getElementById('CurrentUserId');
                    var setButton = document.getElementById('SetButton');
                    var InsertTournamentIdLabel = document.getElementById('InsertTournamentIdLabel');
                    var TournamentIdTextBox = document.getElementById('TournamentIdTextBox');
                    var SetTournamentButton = document.getElementById('SetTournamentButton');

                    if (i == '0') {
                        //alert(i);
                        custom.value = "0," + CurrentUserIdHidden.value + "," + CurrentUserIdHidden.value;
                        InsertTeamIdLabelControl.style.display = "none"; //to hide it
                        TeamIdTextBoxControl.style.display = "none"; //to hide it
                        IsFriendControl.value = '0';
                        MessageLabel.innerHTML = PayForMySelf.value;
                        //MessageLabel.innerHTML = PayForMySelf.value + ": " + custom.value;
                        setButton.style.display = "none"; //to hide it
                        InsertTournamentIdLabel.style.display = "none";
                        TournamentIdTextBox.style.display = "none";
                        SetTournamentButton.style.display = "none";
                    }
                    if (i == '1') {
                        //alert(i);
                        InsertTeamIdLabelControl.style.display = "inline"; //to show it
                        TeamIdTextBoxControl.style.display = "inline"; //to show it
                        IsFriendControl.value = '1';
                        setButton.style.display = "inline"; //to show it
                        //MessageLabel.innerHTML = PayForAnotherTeam.value;
                        InsertTournamentIdLabel.style.display = "none";
                        TournamentIdTextBox.style.display = "none";
                        SetTournamentButton.style.display = "none";

                    }
                    if (i == '2') {
                        
                        InsertTeamIdLabelControl.style.display = "none"; //to hide it
                        TeamIdTextBoxControl.style.display = "none"; //to hide it
                        IsFriendControl.value = '2';
                        setButton.style.display = "none";

                        InsertTournamentIdLabel.style.display = "inline";
                        TournamentIdTextBox.style.display = "inline";
                        SetTournamentButton.style.display = "inline";
                        
                    }
                }
            }
        }

        function HideControl() {
            var InsertTeamIdLabelControl = document.getElementById('InsertTeamIdTitleLabel');
            var TeamIdTextBoxControl = document.getElementById('TeamIdTextBox');
            var setButton = document.getElementById('SetButton');
            InsertTeamIdLabelControl.style.display = "none"; //to hide it
            TeamIdTextBoxControl.style.display = "none"; //to hide it
            setButton.style.display = "none"; //to hide it

        }

    </script>
    <%-- <script type="text/javascript" src="JS/JScript16.js"></script>--%>
</head>
<body style="margin-top: 0px;" class="bg_layer2_pic">
    <input type="hidden" id="CurrentUserIdHidden" runat="server" name="CurrentUserIdHidden"
        clientidmode="Static" enableviewstate="false" />
    <input type="hidden" id="IsFriend" runat="server" name="IsFriend" clientidmode="Static"
        enableviewstate="false" />
    <input type="hidden" id="PayForMySelfHidden" runat="server" name="PayForMySelfHidden"
        clientidmode="Static" enableviewstate="false" />
    <input type="hidden" id="PayForAnotherTeamHidden" runat="server" name="PayForAnotherTeamHidden"
        clientidmode="Static" enableviewstate="false" />
   
    
    <div class="basic_element" style="width:500px; margin:10px auto 0 auto;">
    <div class="red_title">
       <asp:Label ID="TitleLabel" runat="server" Text="<%$ Resources:Resource, Shop_PageTitle %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
    <form id="Form1" runat="server" style="width: 600px;">
    

    
    <asp:HyperLink ID="BackToTheSiteLink" runat="server" NavigateUrl="~/TeamHomePage.aspx"
        Text="<%$ Resources:Resource, Global_BackHome %>" SkinID="GreenTitleHyperLink"></asp:HyperLink>
    <br />
    <br />
    <asp:FormView ID="CurrenrPremiumInfo" runat="server" DataSourceID="PremiumInfoDS">
        <ItemTemplate>
            <asp:Label ID="IsPremiumTitleLabel" runat="server" Visible='<%# Eval("IsPremium") %>'
                SkinID="GridLabel" Text='<%# Resources.Resource.Shop_YouArePremium + " " + Eval("PremiumUntil") %>'></asp:Label>
            <asp:Label ID="IsNotPremiumLabel" runat="server" SkinID="GridLabel" Visible='<%# !(bool)Eval("IsPremium") %>'
                Text="<%$ Resources:Resource, Shop_YouAreNotPremium %>"></asp:Label>
        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="PremiumInfoDS" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetUserPremiumInfo" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    <br />
    <asp:Label ID="MessageLabel" runat="server" Text="<%$ Resources:Resource, Shop_YouArePayingForYourself %>"
        SkinID="GridLabel"></asp:Label>
    <br />
    <%--<table>
    <tr>
    <td>--%>
        <asp:RadioButtonList ID="PayTypeRadioButtonList" runat="server" onclick="showHideControl(this)"
            CssClass="NewsItemStyle">
            <asp:ListItem runat="server" Text="<%$ Resources:Resource, Shop_PayForMySelf %>"></asp:ListItem>
            <asp:ListItem runat="server" Text="<%$ Resources:Resource, Shop_PayForAnotherTeam %>"></asp:ListItem>
            <asp:ListItem runat="server" Text="<%$ Resources:Resource, Shop_PayForTournament %>"></asp:ListItem>
        </asp:RadioButtonList>
    <%--</td>
    <td>--%>
        <asp:Label ID="InsertTeamIdTitleLabel" runat="server" Text="<%$ Resources:Resource, Shop_InsertTheTeamId %>" SkinID="InfoLabel"></asp:Label>
        <asp:TextBox ID="TeamIdTextBox" runat="server"></asp:TextBox>
        <asp:Button ID="SetButton" runat="server" Text="<%$ Resources:Resource, Global_Set %>" OnClick="SetButton_Click" CssClass="GreenSmallButtonStyle" />
        <asp:Label ID="InsertTournamentIdLabel" runat="server" Text="<%$ Resources:Resource, Shop_TournamentId %>" SkinID="InfoLabel"></asp:Label>
        <asp:TextBox ID="TournamentIdTextBox" runat="server" ></asp:TextBox>
        <asp:Button ID="SetTournamentButton" runat="server" Text="<%$ Resources:Resource, Global_Set %>" OnClick="SetTournamentButtonClick" CssClass="GreenSmallButtonStyle" /> 
    <%--</td>
    </tr>
    </table>--%>                
    
                   
    </form>
    <br />
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" id="custom" runat="server" name="custom" clientidmode="Static"
        enableviewstate="false" />
    <input type="hidden" name="cmd" value="_s-xclick" />
    <input type="hidden" name="hosted_button_id" value="RXK55JLQYYUFS" />
    <input type="hidden" name="business" value="NBVJKGNECTSJW" />
    <input type="hidden" name="return" value="http://www.Nivdal.com/CompletePayment.aspx" />
    <input type="hidden" name="cancel_return" value="http://www.Nivdal.com/CancelPurchase.aspx" />
    <input type="hidden" name="notify_url" value="http://www.Nivdal.com/PayPal_IPN.aspx" />
    <input type="hidden" name="return" value="http://www.Nivdal.com/CompletePayment.aspx" />
    <table>
        <tr>
            <td>
                <input type="hidden" name="on0" value="Premiums" />
            </td>
        </tr>
        <tr>
            <td>
                <input type="hidden" name="on0" value="Premiums">
            </td>
        </tr>
        <tr>
            <td>
                <select name="os0">
                    <option value="Payment3Month">
                        <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Resource, Shop_3MonthsPayment %>"></asp:Literal></option>
                    <option value="Payment6Month">
                        <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Resource, Shop_6MonthsPayment %>"></asp:Literal></option>
                    <option value="Payment12Month">
                        <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Resource, Shop_12MonthsPayment %>"></asp:Literal></option>
                </select>
            </td>
        </tr>
    </table>
    <input type="hidden" name="currency_code" value="USD" />
    <input type="image" src="https://www.paypalobjects.com/en_US/IL/i/btn/btn_buynowCC_LG.gif"
        border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"
        width="1" height="1" />
    
    
    </form>
    </div>
    </div>         
</body>
</html>
